package domain;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

public class Account {
	private String accountId;
	private String cardId;
	private String password;
	private String name;
	private BigDecimal balance;

	public String getAccountId() {
		return accountId;
	}

	public void setAccountId(String accountId) {
		this.accountId = accountId;
	}

	public String getCardId() {
		return cardId;
	}

	public void setCardId(String cardId) {
		this.cardId = cardId;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public BigDecimal getBalance() {
		return balance;
	}

	public void setBalance(BigDecimal balance) {
		this.balance = balance;
	}

	public Account() {

	}

	public Account(String accountId, String password, String cardId, String name, BigDecimal balance) {
		this.setAccountId(accountId);
		this.setPassword(password);
		this.setCardId(cardId);
		this.setName(name);
		this.setBalance(balance);
	}
	
	public void toPrint(Account account) {
		 System.out.println("账户号："+account.getAccountId()
		 +" 密码："+account.getPassword()
		 +" 姓名："+account.getName()
		 +" 卡号："+account.getCardId()
		 +" 余额："+account.getBalance());
		
	}

	// 自动创建几个账号
	public List<Account> init() {
		List<Account> accountList = new ArrayList<Account>();
		// 初始化账号信息
		String[] names = { "张三", "李四", "王五" };
		String[] password = { "12345", "123456", "1234567" };
		String[] cardId = { "123", "123456", "123456789" };
		for (int i = 0; i < 3; i++) {
			Account account = new Account("123" + i, password[i], cardId[i], names[i], BigDecimal.valueOf(200 * i));
		     accountList.add(account);
			toPrint(account);
		}
		return accountList;

	}

}
